package com.cs.study.homework._0221;

public class Demo2 {

}

class FinalDemo {
    //final修饰成员变量，显示赋值
    final int a = 0;
    final int b = 0;
    final int c = 0;
    //final修饰静态成员变量，显示赋值
    final static int A = 0;
    final static int B = 0;

}

class FinalDemo2 {
    final int a;
    final int b;
    final int c;

    //final修饰成员变量，构造代码块赋值
    {
        a = 2;
        b = 2;
        c = 2;
    }

    final static int A;
    final static int B;

    //final修饰静态成员变量，静态代码块赋值
    static {
        A = 0;
        B = 0;
    }

}

class FinalDemo3 {

    final int a;
    final int b;
    final int c;

    //final修饰成员变量，构造器赋值
    public FinalDemo3(int a, int b, int c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }
}